import service from "../uitils/request"

export const userPageApi = (params) => {
    return service({
        url: "/userInfo/page",
        method: 'GET',
        params
    })
}
export const saveUserApi = (data) => {
    return service({
        url: "/userInfo",
        method: 'POST',
        data
    })
}

export const userDetailApi = (userId) => {
    return service({
        url: `/userInfo/${userId}`,
        method: 'GET',
    })
}

export const queryUserAuthListApi = (userId) => {
    return service({
        url: 'userInfo/userAuth/list',
        method: 'GET',
        params: {
            userId: userId
        }
    })
}

export const saveUserAuthApi = (data) => {
    return service({
        url: 'userInfo/userAuth',
        method: 'POST',
        data
    })
}

export const deleteUserAuthApi = (authId) => {
    return service({
        url: 'userInfo/userAuth',
        method: 'DELETE',
        params: {
            authId: authId
        }
    })
}


export const dingTalkDeptListApi = () => {
    return service({
        url: 'userInfo/dingTalk/deptList',
        method: 'GET',
    })
}

export const dingTalkDeptUserListApi = (deptId) => {
    return service({
        url: 'userInfo/dingTalk/deptUserList',
        method: 'GET',
        params: {deptId: deptId}
    })
}

export const dingTalkUserDetailApi = (userId) => {
    return service({
        url: 'userInfo/dingTalk/userDetail',
        method: 'GET',
        params: {userId: userId}
    })
}

